﻿using LY.DataAccess.Repository;
using LY.Entity;
using LY.Interface;
using System.Collections.Generic;

namespace LY.Business.ServiceImpl
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的类名“AboutService”。
    public class AboutService : IAboutService
    {
        AboutRepository _about;
        public AboutService()
        {
            _about = new AboutRepository();
        }
        /// <summary>
        /// 检索关于我们下的栏目信息
        /// </summary>
        /// <returns></returns>
        public List<C_Menu> GetMenu(string code)
        {
            return _about.GetMenu(code);
        }
        /// <summary>
        /// 根据栏目ID检索文章信息，返回单个实体对象
        /// </summary>
        /// <param name="menuid"></param>
        /// <returns></returns>
        public C_Article GetArticleMenuId(int? menuid)
        {
            return _about.GetArticleMenuId(menuid);
        }
        /// <summary>
        /// 活动专区中的分页列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public List<C_Article> GetArticleListPage(int? pageIndex, int pageSize)
        {
            return _about.GetArticleListPage(pageIndex, pageSize);
        }
        /// <summary>
        /// 根据文章ID查找文章信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public C_Article GetArticle(int? id)
        {
            return _about.GetArticle(id);
        }
    }
}
